@tailwind base;
@tailwind components;
@tailwind utilities;

/* Custom CSS variables for theming */
:root {
  --toast-bg: #363636;
  --toast-color: #fff;
}

.dark {
  --toast-bg: #1f2937;
  --toast-color: #f9fafb;
}

/* Custom scrollbar styles */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  @apply bg-gray-100 dark:bg-gray-800;
}

::-webkit-scrollbar-thumb {
  @apply rounded-full bg-gray-300 dark:bg-gray-600;
}

::-webkit-scrollbar-thumb:hover {
  @apply bg-gray-400 dark:bg-gray-500;
}

/* Custom focus styles */
.focus-visible {
  @apply outline-none ring-2 ring-primary-500 ring-offset-2 ring-offset-white dark:ring-offset-gray-900;
}

/* Animation utilities */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    transform: translateY(-10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Utility classes */
.animate-fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

.animate-slide-up {
  animation: slideUp 0.3s ease-out;
}

.animate-slide-down {
  animation: slideDown 0.3s ease-out;
}

.animate-scale-in {
  animation: scaleIn 0.2s ease-out;
}

/* Custom component styles */
.glass-effect {
  @apply bg-white/80 backdrop-blur-sm dark:bg-gray-900/80;
}

.card-shadow {
  box-shadow:
    0 1px 3px 0 rgba(0, 0, 0, 0.1),
    0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.dark .card-shadow {
  box-shadow:
    0 1px 3px 0 rgba(0, 0, 0, 0.3),
    0 1px 2px 0 rgba(0, 0, 0, 0.2);
}

/* Typography improvements */
.prose-custom {
  @apply text-gray-700 dark:text-gray-300;
}

.prose-custom h1,
.prose-custom h2,
.prose-custom h3,
.prose-custom h4,
.prose-custom h5,
.prose-custom h6 {
  @apply text-gray-900 dark:text-gray-100;
}

/* Button focus improvements */
button:focus-visible {
  @apply outline-none ring-2 ring-primary-500 ring-offset-2;
}

/* Input focus improvements */
input:focus,
textarea:focus,
select:focus {
  @apply border-primary-500 outline-none ring-2 ring-primary-500;
}

/* Custom selection colors */
::selection {
  @apply bg-primary-200 text-primary-900;
}

.dark ::selection {
  @apply bg-primary-800 text-primary-100;
}

/* Smooth transitions for theme switching */
* {
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

/* Hide default focus outline for mouse users */
.js-focus-visible :focus:not(.focus-visible) {
  outline: none;
}
